﻿using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using LTJ.Common;
using LTJ.FrameWork;

namespace uswinweb.admin
{
    /// <summary>
    /// 用户子菜单管理
    /// </summary>
    public partial class usersubmenu_set : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int submenuid = SASRequest.GetInt("submenuid", 0);
            string id = SASRequest.GetString("id");
            string mode = SASRequest.GetString("mode");
            if (id != "")
            {
                if (mode == "del")
                {
                    //DeleteMainItem(id);
                    ManageMenu.DeleteUserMenuItem(int.Parse(id));
                }
                else
                {
                    if (id == "-1")
                    {
                        ManageMenu.NewUserMenuItem(submenuid, SASRequest.GetString("menutitle"), SASRequest.GetString("defaulturl"), SASRequest.GetString("etitle"), SASRequest.GetInt("opmode", 0));
                    }
                    else
                    {
                        ManageMenu.EditUserMenuItem(int.Parse(id), SASRequest.GetString("menutitle"), SASRequest.GetString("defaulturl"), SASRequest.GetString("etitle"), SASRequest.GetInt("opmode", 0));
                    }
                }
                Caches.ResetUserMenuCache(LTJ.Entity.UserMenuType.SubMenu);
                Response.Redirect("usersubmenu_set.aspx?submenuid=" + submenuid, true);
            }

            ((managemain)Master).ExtendStr = "<a title=\"\" class=\"l_4a779e\" href=\"usermainmenu_set.aspx\">返回上一级</a>";
        }
    }
}